﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Data.Linq;
using System.Text;

namespace mmoss.orm
{
    public partial class InventoryAdjustmentMMC
    {
        public string VendorName
        {
            get
            {
                return this.InventoryItemByVendorMMC.VendorName;
            }
        }
        public string ItemName
        {
            get
            {
                return this.InventoryItemByVendorMMC.ItemName;
            }
        }
    }
    public partial class InventoryItemByVendorMMC
    {
        public string ItemName
        {
            get { return this.InventoryItem.itemShortDesc; }
        }
        public string VendorName
        {
            get { return this.Vendor.vendorName; }
        }
    }
    public partial class InventoryItem 
    {
        public string Value
        {
            get { return this.Id.ToString(); }
        }
        public string Text
        {
            get { return this.itemShortDesc; }
        }
    }
    public static class ExtensionInventory
    {
        public static List<InventoryItemByVendorMMC> GetItemsByType(this Table<InventoryItemByVendorMMC> table
            , int  l_locationID
            , InventoryItemType l_Type)
        {
            List<InventoryItemByVendorMMC> l_return = (from objs in table
                    where objs.InventoryItem.InventoryItemType == l_Type
                    && objs.LocationID == l_locationID
                    select objs).ToList();
            return l_return;
        }
    }
}
